<template>
  <footer>
    <ul>
      <router-link
        v-for="item in list"
        tag="li"
        :key="item.title"
        :to="'/home' + item.url"
      >
        <span class="iconfont" :class="item.icon"></span>
        <p>{{ item.title }}</p>
      </router-link>
    </ul>
  </footer>
</template>

<script>
export default {
  data() {
    return {
      list: [
        {
          title: "电影/影院",
          icon: "icon-dianying",
          url: "/movies",
        },
        {
          title: "视频",
          icon: "icon-shipin",
          url: "/video",
        },
        {
          title: "小视频",
          icon: "icon-xiaoshipinyingshi48",
          url: "/mini",
        },
        {
          title: "演出",
          icon: "icon-yanchu-xianxing2-0",
          url: "/show",
        },
        {
          title: "我的",
          icon: "icon-wode",
          url: "/mine",
        },
      ],
      // activeTitle: sessionStorage.getItem("activetitle") || "电影/影院",
    };
  },
  methods: {
    // tabChange(item) {
    //   // 切换高亮
    //   this.activeTitle = item.title;
    //   // 存到本地存储,目的是为了刷新以后不清除
    //   sessionStorage.setItem("activetitle", this.activeTitle);
    //   // 页面跳转
    //   this.$router.push("/home" + item.url);
    // },
  },
  // watch: {
  //   $route(to) {
  //     console.log(to);
  //   },
  // },
};
</script>

<style lang="less" scoped>
@import "../../../assets/css/var.less";
footer {
  position: fixed;
  width: 100%;
  height: 50px;
  background: @white-color;
  border-top: 1px solid @border-color;
  bottom: 0;
  left: 0;
  font-size: @xs-font;

  ul {
    height: 100%;
    display: flex;

    li {
      flex: 1;
      flex-direction: column;
      .center();

      .iconfont {
        font-size: @xxl-font;
      }

      p {
        margin-top: 3px;
      }
    }

    // router-link-exact-active 都是router-link选中时自动添加的类名
    // router-link-active
    .router-link-active {
      color: @theme-color;
    }
  }
}
</style>
